package org.example.system.model.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Data;
import org.example.system.common.base.BaseEntity;

/**
 * 车辆表
 * @TableName biz_vehicle
 */
@TableName(value ="biz_vehicle")
@Data
public class Vehicle extends BaseEntity implements Serializable {
    /**
     * 车辆编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 车辆品牌
     */
    @TableField(value = "brand")
    private String brand;

    /**
     * 车型 ID(外键)
     */
    @TableField(value = "model_id")
    private Integer modelId;

    /**
     * 车牌号
     */
    @TableField(value = "license_plate")
    private String licensePlate;

    /**
     * 购置日期
     */
    @TableField(value = "buy_time")
    private LocalDate buyTime;

    /**
     * 保险单照片路径
     */
    @TableField(value = "insurance_path")
    private String insurancePath;

    /**
     * 保险到期日期
     */
    @TableField(value = "insurance_expiry")
    private LocalDate insuranceExpiry;

    /**
     * 车辆状态(0:空闲中 1:已预订 2:已出租 3:维修中 4：已报废)
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标识 0：未删除 1已删除
     */
    @TableField(value = "deleted")
    @TableLogic
    private Integer deleted;

    /**
     * 车辆照片路径
     */
    @TableField(value = "photo_path")
    private String photoPath;

    /**
     * 所在网点地址
     */
    @TableField(value = "location_id")
    private Integer locationId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}